home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / include / linux / istallion.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-24  |  3.6 KB  |  126 lines

  1. /*****************************************************************************/
  2.  
  3. /*
  4.  *    istallion.h  -- stallion intelligent multiport serial driver.
  5.  *
  6.  *    Copyright (C) 1996-1998  Stallion Technologies
  7.  *    Copyright (C) 1994-1996  Greg Ungerer.
  8.  *
  9.  *    This program is free software; you can redistribute it and/or modify
  10.  *    it under the terms of the GNU General Public License as published by
  11.  *    the Free Software Foundation; either version 2 of the License, or
  12.  *    (at your option) any later version.
  13.  *
  14.  *    This program is distributed in the hope that it will be useful,
  15.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *    GNU General Public License for more details.
  18.  *
  19.  *    You should have received a copy of the GNU General Public License
  20.  *    along with this program; if not, write to the Free Software
  21.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  */
  23.  
  24. /*****************************************************************************/
  25. #ifndef    _ISTALLION_H
  26. #define    _ISTALLION_H
  27. /*****************************************************************************/
  28.  
  29. /*
  30.  *    Define important driver constants here.
  31.  */
  32. #define    STL_MAXBRDS        4
  33. #define    STL_MAXPANELS        4
  34. #define    STL_MAXPORTS        64
  35. #define    STL_MAXCHANS        (STL_MAXPORTS + 1)
  36. #define    STL_MAXDEVS        (STL_MAXBRDS * STL_MAXPORTS)
  37.  
  38.  
  39. /*
  40.  *    Define a set of structures to hold all the board/panel/port info
  41.  *    for our ports. These will be dynamically allocated as required at
  42.  *    driver initialization time.
  43.  */
  44.  
  45. /*
  46.  *    Port and board structures to hold status info about each object.
  47.  *    The board structure contains pointers to structures for each port
  48.  *    connected to it. Panels are not distinguished here, since
  49.  *    communication with the slave board will always be on a per port
  50.  *    basis.
  51.  */
  52. struct stliport {
  53.     unsigned long        magic;
  54.     struct tty_port        port;
  55.     unsigned int        portnr;
  56.     unsigned int        panelnr;
  57.     unsigned int        brdnr;
  58.     unsigned long        state;
  59.     unsigned int        devnr;
  60.     int            baud_base;
  61.     int            custom_divisor;
  62.     int            close_delay;
  63.     int            closing_wait;
  64.     int            openwaitcnt;
  65.     int            rc;
  66.     int            argsize;
  67.     void            *argp;
  68.     unsigned int        rxmarkmsk;
  69.     wait_queue_head_t    raw_wait;
  70.     struct asysigs        asig;
  71.     unsigned long        addr;
  72.     unsigned long        rxoffset;
  73.     unsigned long        txoffset;
  74.     unsigned long        sigs;
  75.     unsigned long        pflag;
  76.     unsigned int        rxsize;
  77.     unsigned int        txsize;
  78.     unsigned char        reqbit;
  79.     unsigned char        portidx;
  80.     unsigned char        portbit;
  81. };
  82.  
  83. /*
  84.  *    Use a structure of function pointers to do board level operations.
  85.  *    These include, enable/disable, paging shared memory, interrupting, etc.
  86.  */
  87. struct stlibrd {
  88.     unsigned long    magic;
  89.     unsigned int    brdnr;
  90.     unsigned int    brdtype;
  91.     unsigned int    state;
  92.     unsigned int    nrpanels;
  93.     unsigned int    nrports;
  94.     unsigned int    nrdevs;
  95.     unsigned int    iobase;
  96.     int        iosize;
  97.     unsigned long    memaddr;
  98.     void        __iomem *membase;
  99.     unsigned long    memsize;
  100.     int        pagesize;
  101.     int        hostoffset;
  102.     int        slaveoffset;
  103.     int        bitsize;
  104.     int        enabval;
  105.     unsigned int    panels[STL_MAXPANELS];
  106.     int        panelids[STL_MAXPANELS];
  107.     void        (*init)(struct stlibrd *brdp);
  108.     void        (*enable)(struct stlibrd *brdp);
  109.     void        (*reenable)(struct stlibrd *brdp);
  110.     void        (*disable)(struct stlibrd *brdp);
  111.     void        __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
  112.     void        (*intr)(struct stlibrd *brdp);
  113.     void        (*reset)(struct stlibrd *brdp);
  114.     struct stliport    *ports[STL_MAXPORTS];
  115. };
  116.  
  117.  
  118. /*
  119.  *    Define MAGIC numbers used for above structures.
  120.  */
  121. #define    STLI_PORTMAGIC    0xe671c7a1
  122. #define    STLI_BOARDMAGIC    0x4bc6c825
  123.  
  124. /*****************************************************************************/
  125. #endif
  126.